package com.xiaomayi.gateway.controller;

import com.xiaomayi.captcha.utils.CaptchaUtil;
import com.xiaomayi.core.utils.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 验证码 控制器
 * </p>
 *
 * @author 小蚂蚁团队
 * @since 2023-06-12
 */
@RestController
@Tag(name = "验证码", description = "验证码")
@AllArgsConstructor
public class CaptchaController {

    private final CaptchaUtil captchaUtil;

    /**
     * 获取验证码
     *
     * @return 返回结果
     */
    @Operation(summary = "获取验证码", description = "获取验证码")
    @GetMapping("/captcha")
    public R captcha() {
        return R.ok(captchaUtil.getCaptcha());
    }

}
